1. Field of the Invention
The present disclosure relates generally to microprocessor-controlled devices, and more particularly, to providing different modes of operation for the microprocessor-controlled devices in response to the detection of specified conditions.
2. Description of the Background of the Invention
Microprocessors execute programming to control a wide range of electrical and electromechanical devices, from personal computers to automatic dispensers for volatile substances. In such a microprocessor-controlled device, a power source, such as a battery or an electrical outlet, supplies power to the microprocessor and other components of the device. Proper operation of the device is sensitive to fluctuations in the power level supplied by the power source. For example, if the power drops below a threshold operating level of the microprocessor, then the programming executed by the microprocessor to control the device is interrupted and reset. A drop in power can be caused by a variety of intentional or unexpected conditions. For example, a power drop may occur when the device is intentionally turned off to conserve power, when the power source becomes depleted over time, or when a momentary drop in power, i.e., a brownout, occurs because of fluctuations in the power source or because of a resultant increase in current draw caused by the device performing certain functions. In some applications, it may be desirable or even necessary to be able to identify the condition that caused the power drop so that the programming executed by the microprocessor can be modified to resume proper operation of the device when the power is restored above the threshold operating level. Therefore, a need exists for an effective and reliable way to identify a condition that has caused a reset and to resume proper operation of the device based on the identification of the condition. It is also desirable that an implementation of a solution to this problem need only a minimal amount of additional components, such as, e.g., control circuitry, memory, and power supplies.